UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0dHzdOaiLihTTk4rTsqWrJedMCTC4ZCvKDDQNWQJPA0='
WHERE
key_id = '2d2ae894bdf11a31057f2fe1a1f6620f711f35127420ae99c6fdb860b7ab9824'
AND (
token = '0dHzdOaiLihTTk4rTsqWrJedMCTC4ZCvKDDQNWQJPA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)