UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jwrjDTGqHQd+aG6ThJ/C/uRC5ejTyrUCUNpiPT/0Dvc='
WHERE
key_id = '97ca1ffac4b070e6cb938b669c8a1c5d3ecd0e76a713bd844a1172f00b78335f'
AND (
token = 'jwrjDTGqHQd+aG6ThJ/C/uRC5ejTyrUCUNpiPT/0Dvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)