UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kXJn4PfT4psrnC8LL9++VHpzqxqAo1LyJwc/TuCKknI=' 
WHERE 
  key_id = '0a073c7c2e1fdd519b5083ccabee6daf37a0fdbaa35634befe9cbf4e550cee88' 
  AND (
    token = 'kXJn4PfT4psrnC8LL9++VHpzqxqAo1LyJwc/TuCKknI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034