UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iOPMcaO+nFc6iCygH/xF9XHUh8Lok3Vo51g0iL0m+A0='
WHERE
key_id = '8644efaf8704298d9b08e2f0d5d8a7c251ed22465ab2907ad56faf61f2c5f127'
AND (
token = 'iOPMcaO+nFc6iCygH/xF9XHUh8Lok3Vo51g0iL0m+A0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)