UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4g6zRyx5wmvpiYnl864JEIlR7Vn/1v67VZ17mNu7O1A=' 
WHERE 
  key_id = '33e23a51ad8429ae7a038097515c9846d22f2d466e9412f40b7cf11df54b3822' 
  AND (
    token = '4g6zRyx5wmvpiYnl864JEIlR7Vn/1v67VZ17mNu7O1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034