UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uuStv4JZ7xRg5Afl5xM4YOHA1TMNRHk25q+dYrmFRPs='
WHERE
key_id = 'c0e5487f938a2030b8d4afef5b9fb423be2865ff0ba9fd5c5717ec58d2b9da68'
AND (
token = 'uuStv4JZ7xRg5Afl5xM4YOHA1TMNRHk25q+dYrmFRPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)