UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DKBPYeBpOwiUmRLIkcJP4qLgX5QLF9mI+kh2dRZ3LW8='
WHERE
key_id = 'f5eeef40f3ac559a46d3029e3cc83c3233fd92b7204753ad2e08b769f78ed882'
AND (
token = 'DKBPYeBpOwiUmRLIkcJP4qLgX5QLF9mI+kh2dRZ3LW8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)