UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HTs/o4bdbkeu6nXwpaYgG/CfxlhuOsYyjHhwdCeSOuQ='
WHERE
key_id = '837284bb78426eb254d0fe135b9fcaef07ece8fb263f33ea285b3681f24400ee'
AND (
token = 'HTs/o4bdbkeu6nXwpaYgG/CfxlhuOsYyjHhwdCeSOuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)