UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hV1bJmnhtx6n9mjf/g9cZ55tJ+LcUllLE/P+otluW7o=' 
WHERE 
  key_id = 'e186c901f5a9500b7d0e8c764fb07a0e131fccb9294e4f771e84a5a34d002a37' 
  AND (
    token = 'hV1bJmnhtx6n9mjf/g9cZ55tJ+LcUllLE/P+otluW7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045