UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hoADahBA8HkfSLicC29JS8vg2UoK7lUahS4dIE4XJdQ='
WHERE
key_id = 'c9ce52e29f211cb76f2c0056d055c086137431745d75930d5036617b4dd43607'
AND (
token = 'hoADahBA8HkfSLicC29JS8vg2UoK7lUahS4dIE4XJdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)