UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wgnChow1v0yOKAYVGGkBeYSSrlPR+ZfgRpTuxLasWI8='
WHERE
key_id = 'c2dbd9c0c1dac24bc779560dd5d70004ea63dfcc8adbe2d06e2eef8d41df15ec'
AND (
token = 'wgnChow1v0yOKAYVGGkBeYSSrlPR+ZfgRpTuxLasWI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)