UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KDVu/dQ3apQ/tGIDnIPKO/vgVPEPxOeVo5Gh6BZ8ltI='
WHERE
key_id = '1983fd9524f65fef7e7d71534e030506c66f4ab596ca50310fbc0b194b37a1aa'
AND (
token = 'KDVu/dQ3apQ/tGIDnIPKO/vgVPEPxOeVo5Gh6BZ8ltI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)