UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Y/xhSROvy79na51ZouefuKmaZ47NpYJ6Caq65m8Ag0='
WHERE
key_id = '748a7cf3bbcb7ed34dc1750a459d278f9083383c25566f1f176e57b557946a82'
AND (
token = '+Y/xhSROvy79na51ZouefuKmaZ47NpYJ6Caq65m8Ag0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)