UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1uEkKNUZOsAnzmHbN3AgQ4yElZ97R07iyffLgOAxUI8='
WHERE
key_id = '9869286b87c8481243680820425b66c15c558d4d10b5c0cad6790ad01f46e84a'
AND (
token = '1uEkKNUZOsAnzmHbN3AgQ4yElZ97R07iyffLgOAxUI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)