UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gdlx3H/I2DfPJekGi/iHLpl4Qr8w7SXgn4rI4hR2b50='
WHERE
key_id = 'b65c4f7fe424e795a205bfa424c6a98bae0930de2fdf6c85839041ddf1532179'
AND (
token = 'gdlx3H/I2DfPJekGi/iHLpl4Qr8w7SXgn4rI4hR2b50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)