UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kuD1Re/HVijGMaffLvlX6MiNAK+OJbuz1OBupBCrFGI='
WHERE
key_id = '6b1330d567d7e68303647791e0c5eb7a4d6af9eb06dda157fd4578101d49af62'
AND (
token = 'kuD1Re/HVijGMaffLvlX6MiNAK+OJbuz1OBupBCrFGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)