UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7JRnQBgHmcXF8qdJym5GWrsuw/Al2AIVa0RrSCjh29o='
WHERE
key_id = '4497ddfbe929450043638f8e2b525929ca12035c2dd2f65d9aab20b68f75f87d'
AND (
token = '7JRnQBgHmcXF8qdJym5GWrsuw/Al2AIVa0RrSCjh29o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)