UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rL4zmdHher6KFtk/r5TymvG+A+Ku3fFNyCyJZY5wlZQ=' 
WHERE 
  key_id = '9dc68d57dafaf41ab5a4330bd5536bd107148b32913ab42c5d0a935396962ebe' 
  AND (
    token = 'rL4zmdHher6KFtk/r5TymvG+A+Ku3fFNyCyJZY5wlZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049