UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5UnqxABE6RGQ3VZdND9GAUqrLKa1SrC9iZuyF82R4y4=' 
WHERE 
  key_id = '6ea624e6fd3222ec162220a594c7f40c5a97acfc9f05be1fcb9e096329c10152' 
  AND (
    token = '5UnqxABE6RGQ3VZdND9GAUqrLKa1SrC9iZuyF82R4y4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037