UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OTmWUAvBIpaAN6rGgj+ZsbB5XLt55LIuZl4KIv0yibc='
WHERE
key_id = '78be5e7ca2dfc629cd407013a4760e1485febcd2a7f1376e4f8c38aee037cb29'
AND (
token = 'OTmWUAvBIpaAN6rGgj+ZsbB5XLt55LIuZl4KIv0yibc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)