UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j5UdLb4J65xHl3pmeqqLf7pfdVZXF9RmHF4Gae+xiao=' 
WHERE 
  key_id = '76bee083672c2a2e3ac365c8f8cefa9fb6e624f662dbe6763e83a32899fc9ce5' 
  AND (
    token = 'j5UdLb4J65xHl3pmeqqLf7pfdVZXF9RmHF4Gae+xiao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059