UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u9d5nxqsw1eHu1C2DSPE6HVBmD0VQ/NIG/rBDF6sKv8=' 
WHERE 
  key_id = '31ecacbac20020c5394b871da943aa1fa24efc18c6c4437ef879f8cc5545927b' 
  AND (
    token = 'u9d5nxqsw1eHu1C2DSPE6HVBmD0VQ/NIG/rBDF6sKv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030