UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6S7GFCe58dQA7RG58048mtaLH9UMNCrQxZwVSD4a5pk='
WHERE
key_id = 'eafafdd60d6d2795363f793b03c7ea3adf5cede3351bd93b3137dd6033fbecc6'
AND (
token = '6S7GFCe58dQA7RG58048mtaLH9UMNCrQxZwVSD4a5pk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)