UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Edmtw1Xs0YmWKwR2NdIF8otDHA7+msYee3gI3Ie0f1s=' 
WHERE 
  key_id = '4f7e00740452ca03eecc8589275065ab9a4fd3240aebab721b549644c927dce5' 
  AND (
    token = 'Edmtw1Xs0YmWKwR2NdIF8otDHA7+msYee3gI3Ie0f1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029