UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lQdRIuYyju1px1WKV3l5FjFvNFpvx9jLovVvOnESrGo='
WHERE
key_id = '95be31f13d854a6626d8bf031d3c2d64214018f2f3849a8ef1cd3d6a535b7b29'
AND (
token = 'lQdRIuYyju1px1WKV3l5FjFvNFpvx9jLovVvOnESrGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)