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