UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6gwzumJgKosDrlhaLgb19RSzGpjiDubKHpeonSRG4oc='
WHERE
key_id = '58eb201f466e35353736c655b1968ef8ff24b04d04b8f6847ad9c02260a6be6c'
AND (
token = '6gwzumJgKosDrlhaLgb19RSzGpjiDubKHpeonSRG4oc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)