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