UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bIObHOFd88/uoZV+I81npd2WMB99L3yX17BQhW0Cjr8=' 
WHERE 
  key_id = '0644064c14fc24b47edb8033b2d7de04a2813c1ea24de958d9eef6a868a2a574' 
  AND (
    token = 'bIObHOFd88/uoZV+I81npd2WMB99L3yX17BQhW0Cjr8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019