UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vq3P/dZkSqgmSgHbwLlEr2JGhKoJiQwLoBa2V9YZONA='
WHERE
key_id = 'ecaaa344ecf418fc247370aaedbf44a3f507bef8f62ba7b6d9fc064e6886da3e'
AND (
token = 'vq3P/dZkSqgmSgHbwLlEr2JGhKoJiQwLoBa2V9YZONA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)