UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jLM+TlweK5cr3yO+A2N/YDWrvuieF6Txv+o4aJHh0nY=' 
WHERE 
  key_id = '92bff3dc6fe7cd15a86043fd53f07bf4ff70154a4a52cac4c5fd4e9df17e9690' 
  AND (
    token = 'jLM+TlweK5cr3yO+A2N/YDWrvuieF6Txv+o4aJHh0nY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021