UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jmV2hUzBuxrhCaY/84TDTjrV/pnwgTOhpgtf+hQVZYI='
WHERE
key_id = '9a7e3cebfd21c77236c0a0c43084efed74a88bca3535c9a7ec314eb3aeaae993'
AND (
token = 'jmV2hUzBuxrhCaY/84TDTjrV/pnwgTOhpgtf+hQVZYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)