UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v8bfadb1dNTcAMQ5umHW+P6Wqroo38m7u9B2GUtIzqE=' 
WHERE 
  key_id = '45cd92f3219826ef17040c6db04a2352e223fe93416073432dc7bffc86fa78df' 
  AND (
    token = 'v8bfadb1dNTcAMQ5umHW+P6Wqroo38m7u9B2GUtIzqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033