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