UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wUghZTO+BfW3CykLYWZoRDSWVHb6I/WNBV/PPELt3V4='
WHERE
key_id = '00e76e2b595edd5154ea50456011c6d5c40a41980a7a8f0af2cdb0977ac2109e'
AND (
token = 'wUghZTO+BfW3CykLYWZoRDSWVHb6I/WNBV/PPELt3V4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)