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