UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NPv+LPbJesTnf4JlF6Lp0X9LDx/tIVpoVbYUZEdHfBQ='
WHERE
key_id = '2742dfeaf650524ee7e2fb74652f5d7a12500722f9439b0b4c78e68439449410'
AND (
token = 'NPv+LPbJesTnf4JlF6Lp0X9LDx/tIVpoVbYUZEdHfBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)