UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fddOXYCCotqh0V5/mf8RLPC+3OxdNUvj1kYUA7e4/5w=' 
WHERE 
  key_id = '84fbc970944e60eb6c3715e3cbda4f79293fabd9d2d3f5c939fb9cc2503cf2d3' 
  AND (
    token = 'fddOXYCCotqh0V5/mf8RLPC+3OxdNUvj1kYUA7e4/5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023