UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H03cckw5YXQ0/fjl5kIc41key/UjwJD0KHF+ee9NPSQ='
WHERE
key_id = 'ee241eaf5804bb9e1071f46bbbabf0844778a85b72b58f3eebd9a7500305e51d'
AND (
token = 'H03cckw5YXQ0/fjl5kIc41key/UjwJD0KHF+ee9NPSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)