UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sUPyh/e/Gb3tfma2Ki5vPoPJQ8v6ws+MDtckvr9d3UA=' 
WHERE 
  key_id = '7be8ac5f6708a0872ce0faa7e9974edfb6d52d74493dbff1583e4f93801f0ed4' 
  AND (
    token = 'sUPyh/e/Gb3tfma2Ki5vPoPJQ8v6ws+MDtckvr9d3UA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039