UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9JX+gXUd2BmpedeGaXwVdv8pQgJraRDtNunnyDM/LPg='
WHERE
key_id = '97809d7bb116aa8cdfb206ade43615b7fc9835da919287528481038ffb5982b2'
AND (
token = '9JX+gXUd2BmpedeGaXwVdv8pQgJraRDtNunnyDM/LPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)