UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7uSUcNCLf3xGUVEs5v0FbnC+nm8SyOqtzY/SHLMQA/E=' 
WHERE 
  key_id = 'e85a225a36d3bcf546ea1926302e570eff4361dc50b6027e0e586e194d70a268' 
  AND (
    token = '7uSUcNCLf3xGUVEs5v0FbnC+nm8SyOqtzY/SHLMQA/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042