UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'taG3lYlLumjUiDQA/+MOTWd9bjOxwozwB71UgQ3+k4M='
WHERE
key_id = '4d85ef05e5cff70336fd6d5f5a553e756ff9f7df8fe533f97e2cd9441244f1a1'
AND (
token = 'taG3lYlLumjUiDQA/+MOTWd9bjOxwozwB71UgQ3+k4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)