UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PCzjJGyB4gXTzv1/GQ/ilpw/lYM65oaR268/TvL5yXg=' 
WHERE 
  key_id = '2e51e1ddf2c9c18f24dd50bd933f3bea299a6f176b1a27b2b8d2b54d267efcac' 
  AND (
    token = 'PCzjJGyB4gXTzv1/GQ/ilpw/lYM65oaR268/TvL5yXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044