UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EnpOv6cQwsWorkL6Iac3YMIHaKUg4VHkGHaMimKY+dU=' 
WHERE 
  key_id = '2e5dfb229caa111f18a348b226a4b03afcd65c5a63fe1ad559afa37aac7b5acb' 
  AND (
    token = 'EnpOv6cQwsWorkL6Iac3YMIHaKUg4VHkGHaMimKY+dU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019