UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cJ+GmnycBQMKECBD8dguhcpG9xZ1iVGA1rUZHWbTkWg=' 
WHERE 
  key_id = '0ebcb75135ce5529b5ef1d6b9dc52b940da2744ee03052d495e276c738e4add5' 
  AND (
    token = 'cJ+GmnycBQMKECBD8dguhcpG9xZ1iVGA1rUZHWbTkWg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025