UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Psw8LhicKOLM7vP4uHxzmYLgDYdMTFm8RwBzTgrfWpk='
WHERE
key_id = '4dafc6381903a0b7d7fcb34187b6da29f66df6a4db41bd496b35070c7e0a3604'
AND (
token = 'Psw8LhicKOLM7vP4uHxzmYLgDYdMTFm8RwBzTgrfWpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)